<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Auth::routes();

Route::get('/', 'HomeController@index');

//上传图片
Route::resource('photos', 'PhotoController', ['only' => ['store']]);

//后台路由
Route::prefix('admin')->namespace('Admin')->group(function () {
   //后台登陆退出
   Route::get('login', 'LoginController@showLoginForm')->name('admin.login');
   Route::post('login', 'LoginController@login');
   Route::post('logout', 'LoginController@logout')->name('admin.logout');

   Route::middleware('auth.admin:admin')->group(function () {
      require 'admin/index.php';

   });

});
